package com.dehui.traders.ui.viewmodle;

import android.content.Context;
import android.databinding.ObservableArrayList;
import android.databinding.ObservableField;
import android.databinding.ObservableList;

import com.dehui.traders.BR;
import com.dehui.traders.R;
import com.dehui.traders.bean.StrategyDetailBean;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.tatarka.bindingcollectionadapter2.ItemBinding;

/**
 * Created by hqq on 18.3.30.
 */

public class StrateDetailViewModel extends BaseViewModel{

    public ObservableField<String> strateName = new ObservableField<>();

    public ObservableList<StrateDetailItemViewModel> strateDetailObservableList = new ObservableArrayList<>();

    public ItemBinding<StrateDetailItemViewModel> strateItemBinding = ItemBinding.of(BR.viewModel, R.layout.list_item_strate_detail);

    public StrateDetailViewModel(Context context, String name) {
        super(context);
        strateName.set(name);
        initData();
    }

    private void initData() {
        strateDetailObservableList.add(new StrateDetailItemViewModel(context,new StrategyDetailBean("金卡智能\n300271","20.85","6.76%")));
        strateDetailObservableList.add(new StrateDetailItemViewModel(context,new StrategyDetailBean("金卡智能\n300271","20.85","6.76%")));
    }


}
